﻿using System;
using HigLabo.Net.Extensions;


namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class CodeName : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public Int32 Code { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Name { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public CodeName(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        //}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            this.Code = d.ToInt32("code") ?? 0;
            this.Name = d.ToString("name");
        }
    }
}
